Skip to content

Avoid insertion of spurious applies when inlining #2978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Aug 15, 2017

The test case crashed before, because it encountered
a selection with an inserted apply, which should be typed
but was not. The fix prevents inserting the apply.

The test case crashed before, because it encountered
a selection with an inserted apply, which should be typed
but was not. The fix prevents inserting the apply by
overriding the usual behavior in ReTyper.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, LGTM.

val res = super.typedSelect(tree, pt)
assert(tree.hasType, tree)
val qual1 = typed(tree.qualifier, selectionProto(tree.name, pt, this))
val res = untpd.cpy.Select(tree)(qual1, tree.name).withType(tree.typeOpt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why use AnySelectionProto instead of using selectionProto(tree.name, pt, this) as expected type in Retyper.typedSelect?

@liufengyun liufengyun assigned odersky and unassigned liufengyun Aug 24, 2017
@allanrenucci allanrenucci merged commit fe60cc1 into scala:master Sep 25, 2017
@allanrenucci allanrenucci deleted the fix-inline-apply branch December 14, 2017 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants